import request from '@/utils/request'

// 创建产品仓储信息
export function createItemWarehouse(data) {
  return request({
    url: '/wms/item-warehouse/create',
    method: 'post',
    data: data
  })
}

// 更新产品仓储信息
export function updateItemWarehouse(data) {
  return request({
    url: '/wms/item-warehouse/update',
    method: 'put',
    data: data
  })
}

// 删除产品仓储信息
export function deleteItemWarehouse(id) {
  return request({
    url: '/wms/item-warehouse/delete?id=' + id,
    method: 'delete'
  })
}

// 获得产品仓储信息
export function getItemWarehouse(id) {
  return request({
    url: '/wms/item-warehouse/get?id=' + id,
    method: 'get'
  })
}

// 获得产品仓储信息
export function getItemWarehouseByFactoryAndItem(factoryId, itemId) {
  return request({
    url: '/wms/item-warehouse/get/'+ factoryId +'/' + itemId,
    method: 'get'
  })
}

// 获得产品仓储信息分页
export function getItemWarehousePage(query) {
  return request({
    url: '/wms/item-warehouse/page',
    method: 'get',
    params: query
  })
}

// 导出产品仓储信息 Excel
export function exportItemWarehouseExcel(query) {
  return request({
    url: '/wms/item-warehouse/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
